<?PHP $this->_extends('_layouts/manager_layout');?>
<?PHP $this->_block('head');?>
<?PHP $this->_endblock();?>
<?PHP $this->_block('contents');?>
<div class="bottom694"><h1 class="title">邮件模板</h1></div>
<form name="f" action="" method="post">
<table>
	<tr>
		<td width=100>名称</td>
		<td>
			<input name="name" size=80 value="<?=$m->name?>"  >
		</td>
	</tr>
	<tr>
		<td>Email标题</td>
		<td><input type="text" id="title" name="title" value="<?php echo htmlspecialchars($m->title)?>" size=80></td>
	</tr>
	<tr>
		<td colspan=2>
			<?php Q::control('xheditor','content',array('value'=>$m->content,'style'=>"height:400px;width:930px;"))->display()?>
		</td>
	</tr>
	<tr>
		<td></td>
		<td>
			<input type="hidden" name="id" value="<?php echo $m->id?>">
			<input type="button" value="填写完毕,确认提交" onclick="checkF()">
			&nbsp;&nbsp;&nbsp;&nbsp;
			<a href="<?=url('/mailtemplates')?>" style="margin-left:20px" > 返回 </a>
		</td>
	</tr>
</table>
</form>
<script language="javascript">
function checkF(){
	editor=$('textarea[name=content]').xheditor(true)[0].xheditor;
	
	if(document.getElementById("title").value==""){
		alert("请输入标题");return;
	}
	if(editor.getSource==""){
		alert("请输入内容");return;
	}
	document.f.submit();
}
</script>

<div>
	<?php if(isset($sm)&&strlen($sm->desc)){ echo $sm->desc;}?>
</div>
<?php $this->_endblock();?>